home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-10 | 1.7 KB | 50 lines | [TEXT/ToyS] |
- -- Sample AppleScripts for touchMe, 1996 (C) Mizutori Tetsuya
- -- A droplet to change the date time stamp of every file {in the given folder(s)}
- -- that copies its creation date to the modification date by file-by-file.
- -- How to compile this AppleScript: execute "Save As Run-Only..." command!
- -- Usage1: Run this droplet to select a target folder in the prompt dialog.
- -- Usage2: Drag & drop the target folders (or files) onto this droplet icon.
-
- -- Thanks to Jim van Zee for encouraging me to write this wonderful script.
- -- The Macintosh tar application "suntar 2.0.4" has an optional switch
- -- to preserve the modification date, or not, when extracting a tar file.
- -- After extracting the files, haven't you ever changed your mind in another
- -- way the modification date should be? This sample script can be of a help
- -- to you who watnt to copy the creation date to the modification date.
-
-
- tell me to open {(choose folder)}
- --tell me to open {(choose file)}
-
- on open (docList)
- tell application "touchMe"
- activate
- set prefs creation to {enabled:false}
- set prefs modification to {enabled:true, flag:exact}
- end tell
- --
- repeat with theItem in the docList
- if the folder of (info for theItem) is true then
- repeat with theFilename in the list folder theItem
- tell me to SetDateTimeStamp by (alias ((theItem as string) & theFilename))
- end repeat
- else
- tell me to SetDateTimeStamp by theItem
- end if
- end repeat
- --
- tell application "touchMe"
- quit
- end tell
- end open
-
- to SetDateTimeStamp by theFile
- tell application "touchMe"
- set theStamp to fetch theFile
- set theDate to the creation date of theStamp
- -- set theDate to the modification date of theStamp
- set prefs modification to {value:theDate}
- touch theFile
- end tell
- end SetDateTimeStamp
-